package com.example.shoppingmall.service;

import com.example.shoppingmall.dao.SalesMapper;
import com.example.shoppingmall.pojo.Sales;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SalesService {

    @Resource
    SalesMapper salesMapper;

    public List<Sales> getAll(String salesName,int startType,int exclusive,String beginTime,String endTime,int dang,int size){
        int num=(dang-1)*size;
        return salesMapper.getAll(salesName,startType,exclusive,beginTime,endTime,num,size);
    }

    public int count(String salesName,int startType,int exclusive,String beginTime,String endTime){

        return salesMapper.count(salesName,startType,exclusive,beginTime,endTime);

    }

    public int add(Sales sales){

        return salesMapper.add(sales);

    }

    public int del(int id){

        return salesMapper.del(id);

    }


    public int update(Sales sales){

        return salesMapper.update(sales);

    }

    public Sales getById(int id){

        return salesMapper.getById(id);
    }


}
